Repository navigation
Scanner 13 Nov: hot-fixes from the 7 T session - #174
Merged
Merged
Conversation
…ee EPI reference train The reference is the imaging train with every phase encode at zero; each reversed echo is fitted against the mean of its forward neighbours, which cancels the off-resonance phase growing along the train, with the fit estimate_epi_phase uses (now shared as _fit_odd_even). An echo with a forward neighbour on one side only takes the nearest interior fit. Scanner hot-fix, 13 Nov 7 T session: pulserver's EpiPhaseCorrection fits the reference train the EPI sequences now play in a dummy shot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…PyHySCO A centre frequency off the sample's resonance displaces a reversed-phase-encode pair uniformly in opposite directions, by many voxels when the phase-encode bandwidth per voxel is low (exam 5195 series 3: 64 voxels between the pair at 5.3 Hz/voxel). PyHySCO, estimating the field from zero, converged to a wrong solution. The pair's profiles along the phase-encoding axis are now cross-correlated, each image is moved half the lag towards the other, PyHySCO estimates the rest, and the removed displacement is added to field_map (prealign=True by default). Series 3: corrected up/down correlation 0.47 -> 0.97; the sphere's height/width 1.87/1.71 -> 1.23/1.15 (input 1.28/1.20). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
Added b83b248: 🤖 Generated with Claude Code |
…t field The blip-up image sampled at x + b(x) with intensity 1 + db/dx (blip-down at x - b(x), 1 - db/dx), PyHySCO's model, linear along the phase encode and wrapping around; pure torch, no PyHySCO. A field estimated once by correct_susceptibility corrects every later image of the same slice, as applytopup --method=jac does. On exam 5195 series 3 (192x192, 1.1458 mm), applying the estimated field to the blip-up input reproduces correct_susceptibility's blip_up with correlation 0.99998; the 3.9 % max difference is the second interpolation of the pre-aligned image (the composition matches to 8e-15 inside). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fractional pre-alignment interpolated the pair once more before PyHySCO, which blurred it: test_corrected_pair_is_in_the_intensity_units_of_the_input missed its bound (error 0.2441 against 0.2439), and applying the field to the input differed from the corrected image by up to 3.9 %. A roll by whole voxels does not blur; PyHySCO takes the remaining half voxel at most. Series 3 / 5: corrected up/down correlation 0.965 / 0.93 (fractional: 0.966 / 0.938). susceptibility tests: 12 no-argument tests pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MFB6QLT4Ln1yoTKcuQndXh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hot-fixes from the 13 Nov 7 T session, collected here and merged after the scanner confirms them.
tools.estimate_epi_echo_phase: odd/even phase (constant + linear) of every echo of an EPI train from a blip-free reference train; each reversed echo is fitted against the mean of its forward neighbours, which cancels the off-resonance phase growing along the train; the first/last reversed echo takes the nearest interior fit.estimate_epi_phaseand the new function share_fit_odd_even. Used by pulserver'sEpiPhaseCorrection(pulserver #382).bartorch/tools/_correct/{_epi,__init__}.pyreplaced in the scanner's EnvPulserver site-packages (bundlebuild/scanner-2026-11-13/hotfix-epi-ref/)tools.apply_susceptibility: an image corrected with a known displacement field, PyHySCO's model (blip-up sampled at x + b(x), intensity x (1 + db/dx); blip-down at x - b(x)), linear along the phase encode, circular; pure torch. Used by pulserver'sEpiReconto estimate once per slice and apply to every image (pulserver #382).bartorch/tools/_correct/{_susceptibility,__init__}.pyreplaced in the scanner's EnvPulserver site-packages (bundlebuild/scanner-2026-11-13/hotfix-hysco-once/)Checks:
tests/test_correct_epi.py20 passed, 5 skipped (no CUDA device), three new tests for the per-echo fit.docs/api/tools.mdlists the function; the EPI tour still shows the navigator fit and gets a reference-train section after the scanner confirms.Checks (
apply_susceptibility):tests/test_apply_susceptibility.py7 passed. Exam 5195 series 3: applyingcorrect_susceptibility(...).field_mapto the blip-up input reproduces itsblip_upwith correlation 0.99998 (max difference 3.9 %:correct_susceptibilityinterpolates the pre-aligned image a second time; the same composition matches to 8e-15 away from the edges).docs/api/tools.mdgets the row after the scanner confirms.test_correct_susceptibility.py::test_corrected_pair_is_in_the_intensity_units_of_the_inputfails at b83b248 already (pre-alignment), untouched here.🤖 Generated with Claude Code